package org.liubility.server.robot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.liubility.pojo.entity.RobotPostOrder;
import org.liubility.pojo.exception.LBException;
import org.liubility.server.robot.mapper.RobotPostOrderMapper;
import org.liubility.server.robot.service.RobotPostOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Jdragon
 * @email: 1061917196@qq.com
 * @Date: 2020.09.03 22:39
 * @Description:
 */
@Service
public class RobotPostOrderServiceImpl extends ServiceImpl<RobotPostOrderMapper,RobotPostOrder> implements RobotPostOrderService {

    @Autowired
    RobotPostOrderMapper robotPostOrderMapper;

    @Override
    public List<RobotPostOrder> getPostOrder() {
        return this.list();
    }

    @Override
    public RobotPostOrder addPostOrder(RobotPostOrder postOrder) throws LBException {
        if (postOrder.insertOrUpdate()){
            return postOrder;
        }
        throw new LBException("指令接口异常");
    }
}
